#***************************************************************************************************************** # # AdoScript File of Industrial_Business_Process_Management_ADOxx15-v0.3.0 Application Library # # AdoScript for Simulation of Production on Production lines defined by Block Diagrams per Production Time # #------------------------- GENERAL FILE INFOS -------------------------------------------------------------------- # # APPLIES TO: Industrial Business Process Management Toolkit V:1.0 # FILE VERSION: 1.0 # AUTHOR: NEF (BOC AM) # #--------------------------- FILE DEPENDENCIES ------------------------------------------------------------------- # # INCLUDING FILES: 'ASC_RandomDistributions.asc', 'Procedure_ADOTIME_TO_SEC.asc', 'Procedure_SEC_TO_ADOTIME.asc' # # INCLUDED BY: None # #--------------------------- READ BEFORE EDIT -------------------------------------------------------------------- # # --- File History --- # # [NEF, 09.11.2017] # - initial version for Industrial Business Process Management Toolkit # # USAGE: The mechanism triggered by PROGRAMCALL type attribute 'Simulate Production per Production Time' # through NOTEBOOK of selected 'Buffer' object. # # REMARKS: - Industrial_Business_Process_Management_ADOxx15-v0.3.0 Application Library is based # on StartingPoint_BPMN2-0_ADOxx1-3-UL1_v1-01.abl # (https://www.adoxx.org/svn/all-repo/4_StartingPoint_BPMN2.0_ADOxx13UL1/BIN/StartingPoint_BPMN2-0_ADOxx1-3-UL1_v1-01.abl) # provided by ADOxx.org. # # - CLASS 'Group' from BPMN implementation on ADOxx represents stations in production processes # This design decision is based on the rationale to modify initial BPMN implementation on # ADOxx as less as possible. # #--------------------------- EXECUTION SCENARIO ------------------------------------------------------------------ # PRELIMINARY INFO: # -'Buffer' object provides input part/materials required by station (Group Object), or stores # output part/material produced by station. # -'Station' (Group Object) consumes parts/materials as inputs from buffer, and other resources # like time, money, labour etc., processes and produces parts/materials/final products as outputs. # -Check for details the meta-model of Industrial Business Process Management. #----------------------------------------------------------------------------------------------------------------- # 1- User selects a Buffer in any part of production line to simulate whole production line or part of # production line # 2- User enters total production time in interest to simulate production line # 3- Algorithm gets stations ('Group' in BPMN on ADOxx Application Library) and buffers backwards in order # to define the tree for simulation, stores the tree # 4- At cycle-time '00:000:00:00:00', algorithm check for each station in tree for simulation, if there is # enough parts/materials according to 'Quantity' specified in 'Part flow' relation between each buffers # providing input to the station. # 4a- If all parts/materials exists, algorithm activates the station to make # their process for specified their 'Execution time' long, registers 'Execution time' # for this iteration, consumes parts/materials from aforementioned buffers. # 4b- Else, the algorithm skips the station till next Cycle (1 Cycle is 1 second) # 5- Each Cycle, algorithm checks # 5a- algorithm check for each station in tree for simulation, if there is # enough parts/materials according to 'Quantity' specified in 'Part flow' relation between each buffers # providing input to the station. # 5aa- If all parts/materials exists, algorithm activates the station to make # their process for specified their 'Execution time' long, registers # 'Execution time' for this iteration, consumes parts/materials from aforementioned # buffers. # 5ab- Else, the algorithm skips the station till next Cycle (1 Cycle is 1 second) # 5b- Algorithm defines stations which are end of their execution times, produces part/materials into those # stations successor buffers according to 'Quantity' specified in 'Part flow' relation between each buffers # storing output of the station. # 5c- Algorithm logs above-mentioned information to present later on UI and makes printable version # of log available. # 6- Addition to visual presentation of simulation results through 'Chart' objects, the Algorithm # stores results (at the moment just execution time) to be presented by BROWSER on UI. # #----------------------------------------------------------------------------------------------------------------- #***************************************************************************************************************** #global variables required for time conversion # wdpy: working days per year # whpd: working hours per day SETG wdpy:365 SETG whpd:24 SET sLogTxt:"" SET nCurrentBufferObjid:(objid) CC "Core" GET_MODEL_ID objid:(nCurrentBufferObjid) SET nCurrentModelID:(modelid) CC "Modeling" UNDYE_ALL modelid: (nCurrentModelID) SET sProductionTime:"00:000:00:00:00" CC "AdoScript" EDITFIELD title:"Enter production period" caption:"Production time: yy:ddd:hh:mm:ss" text:"00:000:00:00:00" IF (ecode = 0) { CC "AdoScript" LISTBOX entries:"1;10;100;1000" toksep:";" title:"Select Simulation Speed" oktext:"Select" boxtext:"How much faster: " selection:"1000" SET nSimSpeed:(VAL selection) SET sProductionTime:(text) SET nProductionAmount:1 ADOTIME_TO_SEC (sProductionTime) seconds:nProductionTime # remove all previous marks CC "Modeling" UNDYE_ALL modelid:(nCurrentModelID) #reset all required quantities and arrays CC "AQL" EVAL_AQL_EXPRESSION expr: ("<\"Buffer\">") modelid: (nCurrentModelID) SETL lBufferNodeList:(objids) FOR sBufferNode in: (lBufferNodeList) { CC "Core" SET_ATTR_VAL objid: (VAL sBufferNode) attrname: ("Required quantity") val: (0) CC "Core" SET_ATTR_VAL objid: (VAL sBufferNode) attrname: ("RequiredQuantityArray") val: ("") CC "Core" SET_ATTR_VAL objid: (VAL sBufferNode) attrname: ("AvailableQuantityArray") val: ("") } SETL lGroupNodeList:"" ###start with identifying the tree### #get next predecessor group objects. GET_NEXT_GROUPS nBufferObjid:(nCurrentBufferObjid) lNodeList:lGroupNodeList nModelId:(nCurrentModelID) #reset all local cumulative execution times and execution time array FOR sGroupNode in: (lGroupNodeList) { CC "Core" SET_ATTR_VAL objid: (VAL sGroupNode) attrname: ("LocalCumulativeExecutionTime") val: (0) CC "Core" SET_ATTR_VAL objid: (VAL sGroupNode) attrname: ("ExecutionTimeArray") val: ("") } #Loop through total production cycle time. FOR nCycle from: 0 to: (nProductionTime) { SEC_TO_ADOTIME (nCycle) timeexp:timeexp CC "AdoScript" MSGWIN ("Cycle: " + timeexp) CC "AdoScript" SLEEP ms:(1000/nSimSpeed) # remove all previous marks CC "Modeling" UNDYE_ALL modelid:(nCurrentModelID) #----------------------------------------- Start of Forward Chaining based Calculation--------------------------- FOR sGroupNode in: (lGroupNodeList) { SETL bExcFlag:1 SET nGroupNode:(VAL sGroupNode) CC "Core" GET_OBJ_NAME objid: (nGroupNode) SETL sGroupName:(objname) CC "Core" GET_ATTR_VAL objid: (nGroupNode) attrname: ("Execution time") as-string SET sExpectedExecutionTime:(val) ADOTIME_TO_SEC (sExpectedExecutionTime) seconds:nExpectedExecutionTime CC "AQL" EVAL_AQL_EXPRESSION expr: ("{\""+sGroupName+"\"}<-\"Sets (generic) \">\"Random generator (generic)\"<") modelid: (nCurrentModelID) SETL sRandGenObjid:(objids) # run random generation, if there is assigned random genarator IF (sRandGenObjid !="") { RANDOM_GENERATOR nObjid:(nGroupNode) modelId:(nCurrentModelID) variable:(nExpectedExecutionTime) randomValue:nRealExecutionTime SET nRealExecutionTime:((nRealExecutionTime)/60) } ELSE { SET nRealExecutionTime:((nExpectedExecutionTime)/60) } CC "Core" GET_ATTR_VAL objid: (nGroupNode) attrname: ("LocalCumulativeExecutionTime") SETL nLocalCumulativeExecutionTime:(val) #verify timing IF ((nLocalCumulativeExecutionTime <= nCycle)) { #verify that enough material is available CC "Core" GET_CLASS_ID objid: (nGroupNode) SETL nClassId: (classid) CC "Core" GET_CLASS_NAME classid: (nClassId) SETL sClassName:(classname) CC "AQL" EVAL_AQL_EXPRESSION expr: ("({\""+sGroupName+"\":\""+sClassName+"\"} <-\"Parts flow\">\"Buffer\"<)") modelid: (nCurrentModelID) SETL lInboundBuffers: (objids) FOR sInboundBuffer in: (lInboundBuffers) { SETL nInboundBuffer: (VAL sInboundBuffer) CC "Core" GET_ATTR_VAL objid: (nInboundBuffer) attrname: ("Available quantity") SETL nAvailableQuantity:(val) CC "Core" GET_OBJ_NAME objid: (nInboundBuffer) SETL sBufferName:(objname) CC "AQL" EVAL_AQL_EXPRESSION expr: ("(({\""+sGroupName+"\"}<-<\"Parts flow\">) AND ({\""+sBufferName+"\"}-><\"Parts flow\">))") modelid: (nCurrentModelID) #CC "Modeling" DYE (VAL objids ) error-mark CC "Core" GET_ATTR_VAL objid: (VAL objids) attrname:("Quantity") SETL nRequiredQuantity:(val) #update array for chart CC "Core" GET_ATTR_VAL objid: (nInboundBuffer) attrname: ("RequiredQuantityArray") SETL initialRequiredQuantityArray: (val) SETL newRequiredQuantityArray: (tokcat ( initialRequiredQuantityArray , (STR nRequiredQuantity) , " " ) ) CC "Core" SET_ATTR_VAL objid: (nInboundBuffer) attrname: ("RequiredQuantityArray") val: (newRequiredQuantityArray) CC "Core" SET_ATTR_VAL objid: (nInboundBuffer) attrname: ("ProductionAmount") val: (nProductionAmount) IF (nAvailableQuantity < nRequiredQuantity) { #CC "Modeling" DYE (nInboundBuffer ) error-mark CC "AdoScript" MSGWIN ("Not enough material in "+sBufferName+ " available to continue production in station "+sGroupName) SETL sTempLogText:("[at cycle: " +timeexp+"] Not enough material in "+sBufferName+ " available to continue production in station "+sGroupName) SET sLogTxt:(tokcat(sLogTxt, sTempLogText,"\n")) SETL bExcFlag:0 BREAK } } IF (bExcFlag = 1) { CC "Modeling" DYE (nGroupNode) error-mark CC "AdoScript" MSGWIN (sGroupName + " is active") SETL sTempLogText:("[at cycle: " +timeexp+"]"+ sGroupName + " is active") SET sLogTxt:(tokcat(sLogTxt, sTempLogText,"\n")) CC "AdoScript" SLEEP ms:500 #consume parts FOR sInboundBuffer in: (lInboundBuffers) { SETL nInboundBuffer: (VAL sInboundBuffer) CC "Core" GET_ATTR_VAL objid: (nInboundBuffer) attrname: ("Available quantity") SETL nAvailableQuantity:(val) CC "Core" GET_OBJ_NAME objid: (nInboundBuffer) SETL sBufferName:(objname) CC "AQL" EVAL_AQL_EXPRESSION expr: ("(({\""+sGroupName+"\"}<-<\"Parts flow\">) AND ({\""+sBufferName+"\"}-><\"Parts flow\">))") modelid: (nCurrentModelID) CC "Core" GET_ATTR_VAL objid: (VAL objids) attrname:("Quantity") SETL nRequiredQuantity:(val) CC "Core" SET_ATTR_VAL objid: (nInboundBuffer) attrname: ("Available quantity") val: (nAvailableQuantity - nRequiredQuantity) #update array for chart CC "Core" GET_ATTR_VAL objid: (nInboundBuffer) attrname: ("AvailableQuantityArray") SETL initialRequiredQuantityArray: (val) CC "Core" GET_ATTR_VAL objid: (nInboundBuffer) attrname: ("Available quantity") SETL nAvailableQuantity:(val) SETL newAvailableQuantityArray: (tokcat ( initialRequiredQuantityArray , (STR nAvailableQuantity) , " " ) ) CC "Core" SET_ATTR_VAL objid: (nInboundBuffer) attrname: ("AvailableQuantityArray") val: (newAvailableQuantityArray) } #produce parts CC "AQL" EVAL_AQL_EXPRESSION expr: ("({\""+sGroupName+"\":\""+sClassName+ "\"}->\"Parts flow\">\"Buffer\"<)") modelid: (nCurrentModelID) SETL lOutboundBuffers: (objids) FOR sOutboundBuffer in: (lOutboundBuffers) { SETL nOutboundBuffer: (VAL sOutboundBuffer) CC "Core" GET_ATTR_VAL objid: (nOutboundBuffer) attrname: ("Available quantity") SETL nAvailableQuantity:(val) CC "Core" GET_OBJ_NAME objid: (nOutboundBuffer) SETL sBufferName:(objname) CC "AQL" EVAL_AQL_EXPRESSION expr: ("(({\""+sGroupName+"\"}-><\"Parts flow\">) AND ({\""+sBufferName+"\"}<-<\"Parts flow\">))") modelid: (nCurrentModelID) CC "AdoScript" SLEEP ms:50 CC "Core" GET_ATTR_VAL objid: (VAL objids) attrname:("Quantity") SETL nProducedQuantity:(val) CC "Core" SET_ATTR_VAL objid: (nOutboundBuffer) attrname: ("Available quantity") val: (nAvailableQuantity + nProducedQuantity) #update array for chart CC "Core" GET_ATTR_VAL objid: (nOutboundBuffer) attrname: ("AvailableQuantityArray") SETL initialRequiredQuantityArray: (val) CC "Core" GET_ATTR_VAL objid: (nOutboundBuffer) attrname: ("Available quantity") SETL nAvailableQuantity:(val) SETL newAvailableQuantityArray: (tokcat ( initialRequiredQuantityArray , (STR nAvailableQuantity) , " " ) ) CC "Core" SET_ATTR_VAL objid: (nOutboundBuffer) attrname: ("AvailableQuantityArray") val: (newAvailableQuantityArray) } } SETL sTempLogText:("execution time: "+(STR nRealExecutionTime)) SET sLogTxt:(tokcat(sLogTxt, sTempLogText,"\n")) CC "Core" GET_ATTR_VAL objid: (nGroupNode) attrname: ("ExecutionTimeArray") as-string SETL sInitialExecutionTimeArray: (val) SETL sNewExecutionTimeArray:(tokcat(sInitialExecutionTimeArray, (STR nRealExecutionTime), " ")) CC "Core" SET_ATTR_VAL objid: (nGroupNode) attrname: ("ExecutionTimeArray") val: (sNewExecutionTimeArray) SETL nLocalCumulativeExecutionTime: (nLocalCumulativeExecutionTime+(nRealExecutionTime*60)) CC "Core" SET_ATTR_VAL objid: (nGroupNode) attrname: ("LocalCumulativeExecutionTime") val: (nLocalCumulativeExecutionTime) } } #----------------------------------------- End of Forward Chaining based Calculation--------------------------- } CC "AdoScript" MSGWIN hide CREATE_SIMULATION_RESULTS_BROWSER lGroupNodes:lGroupNodeList CC "AdoScript" EDITBOX text:(sLogTxt) title:"Simulation Log" oktext: "Close" } ################################################################################################################## # GET_NEXT_GROUPS ################################################################################################################## # # Description: This procedure gets predecessor stations (Group objects) backwards from given Buffer Object. # For each station (Group objects)'GET_NEXT_BUFFERS' procedure is triggered To get predecessor buffer(s) # #----------------------------------------------------------------------------------------------------------------- # # Input: - nBufferObjid (integer) - objid of Buffer Object # - nModelId (integer) - Model-id # #----------------------------------------------------------------------------------------------------------------- # # Output: - lNodeList (reference) - List of nodes in tree used for simulation # ################################################################################################################## PROCEDURE global GET_NEXT_GROUPS nBufferObjid:integer lNodeList:reference nModelId:integer { #CC "Modeling" DYE (nBufferObjid ) error-mark CC "Core" GET_OBJ_NAME objid: (nBufferObjid) SETL sBufferName:(objname) CC "Core" GET_CLASS_ID objid: (nBufferObjid) SETL nClassId: (classid) CC "Core" GET_CLASS_NAME classid: (nClassId) SETL sClassName:(classname) CC "AQL" EVAL_AQL_EXPRESSION expr: ("({\""+sBufferName+"\":\""+sClassName+"\"}<-\"Parts flow\">\"Group\"<)") modelid: (nModelId) SETL lChilderenBufferNodeList:(objids) FOR sNode in: (lChilderenBufferNodeList) { SETL nNode:(VAL sNode) GET_NEXT_BUFFERS nGroupObjid:(nNode) lNodeList:lNodeList nModelId: (nModelId) } } ################################################################################################################## # GET_NEXT_BUFFERS ################################################################################################################## # # Description: This procedure gets predecessor buffers (buffer objects) backwards from given station (Group # Object.) # For each buffer 'GET_NEXT_GROUP' procedure is triggered to get predecessor stations(s) #----------------------------------------------------------------------------------------------------------------- # # Input: - nGroupObjid (integer) - objid of Group Object (station) # - nModelId (integer) - Model-id # #----------------------------------------------------------------------------------------------------------------- # # Output: - lNodeList (reference) - List of nodes in tree used for simulation # ################################################################################################################## PROCEDURE global GET_NEXT_BUFFERS nGroupObjid:integer lNodeList:reference nModelId:integer { #CC "Modeling" DYE (nGroupObjid ) error-mark CC "Core" GET_OBJ_NAME objid: (nGroupObjid) SETL sGroupName:(objname) CC "Core" GET_CLASS_ID objid: (nGroupObjid) SETL nClassId: (classid) CC "Core" GET_CLASS_NAME classid: (nClassId) SETL sClassName:(classname) CC "AQL" EVAL_AQL_EXPRESSION expr: ("({\""+sGroupName+"\":\""+sClassName+"\"}<-\"Parts flow\">\"Buffer\"<)") modelid: (nModelId) SETL lChildrenBufferNodeList: (objids) FOR sNode in: (lChildrenBufferNodeList) { SETL nNode:(VAL sNode) GET_NEXT_GROUPS nBufferObjid:(nNode) lNodeList:lNodeList nModelId: (nModelId) } SETL lNodeList:(tokcat(lNodeList, STR nGroupObjid)) } ################################################################################################################## # CREATE_SIMULATION_RESULTS_BROWSER ################################################################################################################## # # Description: This procedure visits registries (e.g. ExecutionTimeArray) of each station used during # simulation. # Triggers procedure 'CALCULATE_AVERAGE' to calculate averages # Creates content structure to present simulation results via 'BROWSER' #----------------------------------------------------------------------------------------------------------------- # # Input: - lGroupNodes (reference) - stations (Group) nodes in tree used for simulation # #----------------------------------------------------------------------------------------------------------------- # # Output: - # ################################################################################################################## PROCEDURE CREATE_SIMULATION_RESULTS_BROWSER lGroupNodes:reference { SETL sFirstRowStations:" " SETL sSecondRowAvgExecutionTimes:"Average Execution Time: " SETL sThirdRowAvgWaitingTimes:"Average Waiting Time: " SETL sForthRowAvgTransportTimes:"Average Transport Time: " SETL sFifthRowAvgCost:"Average Cost: " FOR sGroupNodes in: (lGroupNodes) { SETL nGroupNodes: (VAL sGroupNodes) CC "Core" GET_OBJ_NAME objid: (nGroupNodes) SET sFirstRowStations: (tokcat(sFirstRowStations, (objname), (";"))) CC "Core" GET_ATTR_VAL objid: (nGroupNodes) attrname: ("ExecutionTimeArray") SETL sExectionTimeArray:(val) SET aExectionTimeArray: (valarray(sExectionTimeArray, " ")) CALCULATE_AVERAGE registry: (aExectionTimeArray) average:average SET sSecondRowAvgExecutionTimes: (tokcat (sSecondRowAvgExecutionTimes, (STR average), (";"))) SET sThirdRowAvgWaitingTimes: (tokcat (sThirdRowAvgWaitingTimes, ("N/A"),(";"))) SET sForthRowAvgTransportTimes: (tokcat (sForthRowAvgTransportTimes, ("N/A"),(";"))) SET sFifthRowAvgCost: (tokcat (sFifthRowAvgCost, ("N/A"),(";"))) } SET sBrowserContent: (tokcat (sFirstRowStations, sSecondRowAvgExecutionTimes, ("\t"))) SET sBrowserContent: (tokcat (sBrowserContent, sThirdRowAvgWaitingTimes, ("\t"))) SET sBrowserContent: (tokcat (sBrowserContent, sForthRowAvgTransportTimes, ("\t"))) SET sBrowserContent: (tokcat (sBrowserContent, sFifthRowAvgCost, ("\t"))) CC "AdoScript" BROWSER title:"Simulation Results" content:(sBrowserContent) linesep:"\t" adjust-rows with-handlecolumn alignment:"LR" header:"Save\nsimulation results" print-header:"Print\nsimulation results" } ################################################################################################################## # CALCULATE_AVERAGE ################################################################################################################## # # Description: This procedure extends the functionality of menu entry "New" # If version numbering is being used it ensures that the newly created model will get # the correct version number, and then a history entry is being added. # If we don't use the version numbering it only adds the history entry. #----------------------------------------------------------------------------------------------------------------- # # Input: - registry (array) - Registry of any numeric simulation results # #----------------------------------------------------------------------------------------------------------------- # # Output: - average (reference) - Average of entries in the registry # ################################################################################################################## PROCEDURE CALCULATE_AVERAGE registry:array average:reference { SET nLenArray: (LEN registry) SET nTotal:0 FOR i from:0 to:(nLenArray-1) { SET nTotal:(nTotal+registry[i]) } SET average:(nTotal/nLenArray) } ################################################################################################################## # RANDOM_GENERATOR ################################################################################################################## # # Description: This procedure gets distribution type of random generator assigned to a object. # According to type of random generator it decides which attributes values should be gathered # from random generator object defined by user, overload distribution function, create and deliver # random value back. # This procedures relias on 11 distribution functions implemented in 'ASC_RandomDistributions.asc' namely; # - Standard Uniform Distribution # - Uniform Distribution # - Standard Normal Distribution # - Normal Distribution # - Triangular Distribution # - Exponential Distribution # - Discrete Distribution # - Discrete Uniform Distribution # - Bernoulli Distribution # - Rademacher Distribution # - Coin Toss #----------------------------------------------------------------------------------------------------------------- # # Input: - nObjid (integer) - Objid of Object, to which a random generator is assigned # - modelId (integer) - Model-id # - variable (real) - any predefined expected (numeric) value # #----------------------------------------------------------------------------------------------------------------- # # Output: - randomValue (reference) - Randomly generated value # ################################################################################################################## PROCEDURE global RANDOM_GENERATOR nObjid:integer modelId:integer variable:real randomValue:reference { CC "Core" GET_OBJ_NAME objid: (nObjid) SET sObjName:(objname) CC "AQL" EVAL_AQL_EXPRESSION expr: ("{\""+sObjName+"\"}<-\"Sets (generic)\">\"Random generator (generic)\"<") modelid: (modelId) SET sRandomGenObjId: (objids) SET nRandomGenObjId: (VAL sRandomGenObjId) #get distribution type of random generator CC "Core" GET_ATTR_VAL objid: (nRandomGenObjId) attrname: ("Distribution type") SETL sDT:(val) SET randomValue:0 #get values and load random generation function according to distribution type IF (sDT = ("Standard Uniform Distribution")) { SET randomValue: (randomStandardUniformDist()) SET randomValue: (variable*randomValue) } IF (sDT = ("Uniform Distribution")) { CC "Core" GET_ATTR_VAL objid: (nRandomGenObjId) attrname: ("Lower limit") SET rea_lowlimit:(val) CC "Core" GET_ATTR_VAL objid: (nRandomGenObjId) attrname: ("Upper limit") SET rea_uplimit:(val) SET randomValue: (randomUniformDist(rea_lowlimit, rea_uplimit)) } IF (sDT = ("Standard Normal Distribution")) { SET randomValue: (randomStandardNormalDist()) SET randomValue: (variable*randomValue) } IF (sDT = ("Normal Distribution")) { CC "Core" GET_ATTR_VAL objid: (nRandomGenObjId) attrname: ("Expectancy value") SET rea_expectancy:(val) CC "Core" GET_ATTR_VAL objid: (nRandomGenObjId) attrname: ("Standard deviation") SET rea_stddev:(val) SET randomValue: (randomNormalDist(rea_expectancy, rea_stddev)) } IF (sDT = ("Triangular Distribution")) { CC "Core" GET_ATTR_VAL objid: (nRandomGenObjId) attrname: ("Lower limit") SET rea_lowlimit:(val) CC "Core" GET_ATTR_VAL objid: (nRandomGenObjId) attrname: ("Upper limit") SET rea_uplimit:(val) CC "Core" GET_ATTR_VAL objid: (nRandomGenObjId) attrname: ("Mode") SET rea_mode:(val) SET randomValue: (randomTriangularDist(rea_lowlimit, rea_mode, rea_uplimit)) } IF (sDT = ("Exponential Distribution")) { CC "Core" GET_ATTR_VAL objid: (nRandomGenObjId) attrname: ("Scale") SET rea_scale:(val) SET randomValue:(randomExponentialDist(rea_scale)) SET randomValue:(variable*randomValue) } IF (sDT = ("Discrete Distribution Positions")) { CC "Core" GET_ATTR_VAL objid: (nRandomGenObjId) attrname: ("Probabilities array") SET arr_probabilites:(val) SET arr_probabilites:(valarray(arr_probabilites)) SET randomValue:(randomDiscreteDistPositions(arr_probabilites)) SET randomValue:(variable*randomValue) } IF (sDT = ("Discrete Distribution Values")) { CC "Core" GET_ATTR_VAL objid: (nRandomGenObjId) attrname: ("Probabilities map") SET map_probabilites:(val) SET map_probabilites:(strarray(map_probabilites)) SET randomValue:(randomDiscreteDistValues(map_probabilites)) SET randomValue:(variable*randomValue) } IF (sDT = ("Discrete Uniform Distribution")) { CC "Core" GET_ATTR_VAL objid: (nRandomGenObjId) attrname: ("Lower limit") SET int_lowlimit:(INT val) CC "Core" GET_ATTR_VAL objid: (nRandomGenObjId) attrname: ("Upper limit") SET int_uplimit:(INT val) SET randomValue:(randomDiscreteUniformDist(int_lowlimit, int_uplimit)) } IF (sDT = ("Bernoulli Distribution")) { CC "Core" GET_ATTR_VAL objid: (nRandomGenObjId) attrname: ("Probability") SET rea_prob:(val) SET randomValue:(randomBernoulliDist(rea_prob)) } IF (sDT = ("Rademacher Distribution")) { SET randomValue:(randomRademacherDist()) } IF (sDT = ("Coin Toss")) { SET randomValue:(randomCoinToss()) } }